/**
 * Copyright (C) 2011 The Android Open Source Project 
 * Emial : guoyil199@163.com
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at 
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0 
 * 
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License. 
 */ 
package com.example.app.activity;

import android.os.Bundle;
import android.view.Menu;

import com.BaseActivity;
import com.example.app.R;
import com.example.app.utils.Logcat;
import com.example.app.widget.SlidingDrawer;


/**
 * @author Administrator
 * @Email guoyil199@163.com
 * @version V1.0
 * @Date 2015年8月17日 上午9:38:05
 * @Title <B>抽屉Demo</B>
 * <pre>todo</pre>
 */

public class SlidingDrawerActivity extends BaseActivity {
	private Logcat mlogcat;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		mlogcat = new Logcat();

		// requestWindowFeature(Window.FEATURE_NO_TITLE);
		// getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
		// WindowManager.LayoutParams.FLAG_FULLSCREEN);

		// setContentView(R.layout.activity_demo_1);
		// setContentView(R.layout.layout_sliding_drawer);

		setContentView(R.layout.slidingdrawer_activity_main);

		SlidingDrawer t2b = (SlidingDrawer) findViewById(R.id.drawer_top_down);
		// SlidingDrawer b2t = (SlidingDrawer)
		// findViewById(R.id.drawer_bottom_up);
		// SlidingDrawer l2r = (SlidingDrawer)
		// findViewById(R.id.drawer_left_to_right);
		// SlidingDrawer r2l = (SlidingDrawer)
		// findViewById(R.id.drawer_right_to_left);

		OnDrawerScrollListener onDrawerScrollListener = new OnDrawerScrollListener();
		t2b.setOnDrawerScrollListener(onDrawerScrollListener);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		return true;
	}

	private class OnDrawerScrollListener implements SlidingDrawer.OnDrawerScrollListener {

		@Override
		public void onPreScrollStarted() {
			mlogcat.d("entry");
		}
		@Override
		public void onScrollStarted() {
			mlogcat.d("entry");
		}
		@Override
		public void onScroll(boolean willBackward) {
			if (willBackward) {
				mlogcat.w("willBackward ? ", true);
			}
		}
		@Override
		public void onScrollEnded() {
			mlogcat.d("entry");
		}

	}
	
	
}
